The Role of Drying Schedule and Conditioning in Moisture Uniformity in Wood: A Machine Learning Approach

Monitoring the moisture content (MC) of wood and avoiding large MC variation is a crucial task as a large moisture spread after drying significantly devalues the product, especially in species with high green MC spread. Therefore, this research aims to optimize kiln-drying and provides a predictive approach to estimate and classify target timber moisture, using a gradient-boosting machine learning model. Inputs include three wood attributes (initial moisture, initial weight, and basic density) and three drying parameters (schedule, conditioning, and post-storage). Results show that initial weight has the highest correlation with the final moisture and possesses the highest relative importance in both predictive and classifier models. This model demonstrated a drop in training accuracy after removing schedule, conditioning, and post-storage from inputs, emphasizing that the drying parameters are significant in the robustness of the model. However, the regression-based model failed to satisfactorily predict the moisture after kiln-drying. In contrast, the classifying model is capable of classifying dried wood into acceptable, over-, and under-dried groups, which could apply to timber pre- and post-sorting. Overall, the gradient-boosting model successfully classified the moisture in kiln-dried western hemlock timber.


Introduction
Timber drying impacts the final product quality and plays an essential role in the dimensional stability, and mechanical properties of timber, as the physical [1], elastic and viscoelastic properties of wood are moisture-dependent [2]. Additionally, timber drying facilitates coating, cutting, and remanufacturing procedures, rendering dried wood less susceptible to deformation, cracks, and decay [3,4]. Target moisture (M t ) in kiln-drying should correspond to the indoor or outdoor environment where the final product will be used. A well-managed drying operation dramatically improves timber drying quality [5,6].
Considerable variability in initial moisture (M i ) among timber pieces of the same kiln batch is inevitable, especially in softwoods with substantial differences between the properties of sapwood and heartwood [7]. Different timber pieces in the same load undergo various drying levels due to inherent variations in M i and other wood properties [8,9]. Consequently, final moisture (M f ) among timber fluctuates along a broad range. Large-scale kilns aggravate this problem because of the non-uniform kiln-drying conditions in the chamber's width, depth, and height [10]. Non-uniformity of the final moisture between kiln-dried timber pieces substantially impacts their monetary values. Over-dried wood is in less demand in the market since over-drying increases shrinkage and shapes distortion [11]. Additionally, under-dried wood is hardly acceptable in the market due to its susceptibility to fungal decay and low mechanical strength [11].
Almost every wood species requires a specific drying schedule, which could be timebased, moisture-based, or combined [12]. Drying schedules involve predetermined heat, humidification, ventilation, and air circulation [13,14]. Combined (time-and moisturebased) schedules typically apply to the kiln-drying coastal softwood species in British Columbia, Canada. In a combined schedule, drying factors are time-based from the beginning of the drying until around the fiber saturation point (M fsp ). However, upon reaching that point, they become constant until reaching M t . Drying schedules' aggressiveness influences the final moisture variation in a kiln batch [8,15]. Moreover, post-drying steps such as conditioning in kilns and outdoor storage may apply to reduce moisture variation within and between timber pieces [16,17]. Conditioning is a high-humidity step at the end of some drying schedules (after reaching M t ) to minimize the moisture differences between and within timber pieces (shell and core of timber) and relieve internal stresses (casehardening) [9]. However, some Japanese sawmills use stickers and store kiln-dried batches outdoors for a period of one to two weeks to reduce the moisture variation and moisture profile in thickness, resulting in internal stress dissipation [16].
Pacific coast hemlock (also known as "hem-fir") is an abundant source of fiber on the British Columbia coast which is comprised of western hemlock (Tsuga heterophylla) and amabilis fir (Abies amabilis) [18]. Thick solid hem-fir products, specifically timbers with cross-sectional areas of 90 × 90 mm 2 , 105 × 105 mm 2 , and 115 × 115 mm 2 (also known as "baby-squares") are commonly the preferred material in timber construction, especially in Japan, which is one of BC's largest overseas markets [19]. Hemlock is a difficult-to-dry species due to its naturally high green moisture content, the presence of wet wood (or wet pockets), and often compression wood. Past research focused on optimizing drying schedules [15,20,21], pre-sorting [22][23][24], and post-sorting [25] strategies. Studies examining the collapse and recovery during the drying process [26,27], cracking occurrence during the drying process [28], and numerical simulations of coupled moisture and heat transfer in wood during kiln drying [29] were also reported in the literature. Kiln-drying scheduling is also covered in some studies [30,31] as an important factor impacting the final moisture content and drying defects [32]. In addition, previous studies focused on characterizing and modeling final moisture and its spread in air-dried [33], radio-frequency kiln-dried [34][35][36], heat treated [37], and heat-and-vent kiln-dried batches [38][39][40]. Additionally, previous studies investigated moisture prediction in kiln-dried lumber merely based on wood properties; however, the combined effects of drying conditions and wood properties on the moisture uniformity after kiln-drying still represent a knowledge gap [41]. Furthermore, initial wood indices, especially M i content and its variation, remarkably affect M f variation. Therefore, a holistic approach is required to characterize the combined effects of wood indices and drying schedules on wood properties after kiln-drying [38]. For this reason, the current study aims to investigate and predict the M f of kiln baby-square western hemlock under different schedules.
Accordingly, a machine learning approach was adopted to study the relationship between the wood properties and to quantify the roles of drying schedule, conditioning, and post-storage. This study uses a gradient-boosting algorithm known as TreeNet for moisture prediction and classification. The most widely used machine learning models in the literature on wood science and technology are artificial neural networks (ANNs). They have been used in a wide range of applications for wood identification [42,43], defect detection [42,43], and wood properties prediction [44,45]. The most emphases were on employing the multilayer perceptron (MLP) model [46][47][48]. However, compared to ANNs, fewer studies investigated the performance of ensemble machine learning methods such as gradient boosting for predicting wood properties. Ensemble learning improves prediction accuracy by using multiple machine learning algorithms known as a weak learner and fusing the results by applying a different voting mechanism [49]. This study uses the TreeNet gradient boosting model, variable clustering, and correlation analysis to predict the M f in kiln-dried western hemlock and explain the role of initial wood properties, drying schedules, and conditioning on the moisture distribution in dried timber.

Materials
A local sawmill located on Vancouver Island, British Columbia provided 96 timber pieces of second-growth western hemlock baby squares (116 mm × 116 mm; 3.96 m in length) for this study. All timber pieces were in green condition with a grade of II (standard) or better [50]. Each piece was cut into four kiln specimens and five cookies using a circular saw. Figure 1 represents the cutting protocol. According to the cutting protocol, one section of 100 mm in length was removed from each end of every timber piece to mitigate the risk of end moisture loss. Subsequently, four kiln specimens and five cookies were cut from each timber piece. The length of the kiln specimens and cookies were 900 mm and 25 mm, respectively. Overall, 480 cookies and 384 kiln specimens were provided from the entire timber population. predict the Mf in kiln-dried western hemlock and explain the role of initial wood properties, drying schedules, and conditioning on the moisture distribution in dried timber.

Materials
A local sawmill located on Vancouver Island, British Columbia provided 96 timber pieces of second-growth western hemlock baby squares (116 mm × 116 mm; 3.96 m in length) for this study. All timber pieces were in green condition with a grade of II (standard) or better [50]. Each piece was cut into four kiln specimens and five cookies using a circular saw. Figure 1 represents the cutting protocol. According to the cutting protocol, one section of 100 mm in length was removed from each end of every timber piece to mitigate the risk of end moisture loss. Subsequently, four kiln specimens and five cookies were cut from each timber piece. The length of the kiln specimens and cookies were 900 mm and 25 mm, respectively. Overall, 480 cookies and 384 kiln specimens were provided from the entire timber population.

Experiments
Cookies were used to measure Mi and basic density (ρb) according to Kollmann [51] and Skaar [52]. In the next step, six out of 384 kiln specimens were arbitrarily discarded, and the rest (378 kiln specimens) were randomly assigned to nine drying batches. Table 1 summarizes the nine drying runs used in this study. The control drying schedule was applied to the first drying batch, followed by conditioning. The first modified drying schedule had four modes as the combination of presence and absence of conditioning and post-storage. Similarly, the second modified drying schedule had four modes as the combination of existence and nonexistence of conditioning and post-storage.

Experiments
Cookies were used to measure M i and basic density (ρ b ) according to Kollmann [51] and Skaar [52]. In the next step, six out of 384 kiln specimens were arbitrarily discarded, and the rest (378 kiln specimens) were randomly assigned to nine drying batches. Table 1 summarizes the nine drying runs used in this study. The control drying schedule was applied to the first drying batch, followed by conditioning. The first modified drying schedule had four modes as the combination of presence and absence of conditioning and post-storage. Similarly, the second modified drying schedule had four modes as the combination of existence and nonexistence of conditioning and post-storage. Each drying batch contained 42 timber specimens. The M i and ρ b could influence the M f and needed to be neutralized to make the drying results comparable between all drying batches. Therefore, the entire timber population was categorized into nine groups so that M i and ρ b had the smallest standard deviation. The cross-sections of the specimens were coated using polyvinyl acetate (PVA) before drying to prevent end moisture loss. A conventional heat-and-vent kiln with a capacity of 0.73 m 3 in FPInnovations, Vancouver, British Columbia was used for this research. The same aluminum stickers, with a weight and length of 8.94 kg and 19 mm, respectively, were used for each drying run, which contained 42 kiln specimens (six rows and seven columns).
The drying schedule developed in the past [53,54] was used as the control (unmodified) schedule. This time-based schedule consisted of eight steps, using a pre-determined number of hours for each step. In step nine, the drying process was switched to a moisture contentbased schedule, drying the timber to the M t without changing the settings. The M t was set to 12%, the average equilibrium moisture content M emc in Japan from October to May [16]. This M t was chosen to avoid additional moisture loss from the specimens during postdrying storage time. The last step (conditioning) was time-based. After completing a drying run, the timber pieces cooled down for twelve hours inside the kiln with the doors closed. In addition to the control schedule, two modified drying schedules were also used. In schedule I, the same dry-bulb temperature was reached in the last step and the M emc decreased more aggressively. Schedule II was considered an aggressive drying schedule because it reached a higher dry-bulb temperature in the final drying step, having a steep reduction in M emc . Furthermore, the M f was kept under 93 • C to avoid developing a honeycomb. Tables 2-4 illustrate the control schedule, schedule I, and schedule II, respectively. All kiln specimens were reweighed post-drying to evaluate their final moisture M f . Table 2. Control (unmodified) drying schedule used in industrial kilns in British Columbia sawmills. This schedule comprises eight time-based steps, one moisture-based step, and one conditioning step.
Step  Table 3. First modified schedule. This schedule comprises six time-based steps and one moisturebased step, followed by optional conditioning (step 8) and optional post-storage (step 9).
Step  Table 4. Second modified schedule. This schedule comprises five time-based steps and one moisturebased step, followed by optional conditioning (step 7) and optional post-storage (step 8).
Step After kiln-drying, all timber pieces were reweighed. The kiln-dried weight or final weight (w f ) of each sample was used to calculate its M f , according to the equations documented in Perre [8] and Siau [55].

Machine Learning
The model inputs included M i , w i , ρ b , types of drying schedule (control, I, II), conditioning (Yes/No), and post-drying storage (Yes/No). The objective was to predict the M f and classify the timber condition after drying. Accordingly, the boards with M f < 10 and M f ≥ 19 were labeled as over-dried and under-dried, respectively. Additionally, boards with 10 ≤ M f < 19 were labeled as normal. TreeNet, a gradient-boosting algorithm, was used for both the regression and classification tasks. It uses the decision tree-based CART model [56] for ensemble learning. Decision tree models are easy to interpret, and the importance of the predictor variables and their relationships can be identified through exploratory data analysis. Details of the CART model can be found elsewhere [57,58]. The CART algorithm was successfully used for check prediction in weathered thermally modified timber [59] and for characterization and classification of artificially weathered wood [60][61][62]. Ensemble learning based on bagging or boosting algorithms could be applied to reduce the variance of a single prediction by a tree using multiple weak learners (decision tree). A benchmark study on medium-sized data has shown that tree-based ensemble models such as XGBoost (eXtreme Gradient Boosting) and random forest could outperform the ANNs despite the presence of irregular patterns in the target function and uninformative features [63]. Random forest uses the bagging method, in which each tree is trained using a subset of data, and the model output is based on the voting scheme among weak learners [64]. Random forest was used to predict the mechanical properties of wood fiber insulation boards [65]. It is also utilized in wood machining for tool temperature prediction [66] and frozen lumber classification [67].
Unlike bagging methods, in which weak learners are trained in a similar way, boosting methods perform the training process sequentially, whereas subsequent models correct the performance of prior models. In the gradient-boosting algorithm of TreeNet, a subset of data is used to train a CART model with a maximum number of terminal nodes or tree depth. Then, the CART model is updated depending on the loss function but shrinks the update by the defined learning rate. The process is repeated, and CART models are sequentially added for a specified number of iterations, equal to the number of trees to build [68]. Boosting methods are used for wood species recognition [69], online color classification systems of solid wood flooring [70], predicting the mechanical properties of wood composite [71], and wood machining monitoring [72]. In this study, the number of trees was set to 2000. Additionally, the maximum terminal node per tree and the minimum number of cases allowed for a tree were set to 12 and 3, respectively. Additionally, the learning rate and subsample fraction were equal to 0.01 and 0.3, respectively. Finally, the Polymers 2023, 15, 792 6 of 17 number of predictors for node splitting was equal to the square root of the total number of predictors.

Results and Discussion
The results will analyze and characterize the selected initial and final wood indices and their correlation with drying parameters, drying schedule aggressiveness, drying condition, and post-drying storage. Then, a predictive approach will be provided to estimate the M f of each timber piece based on its corresponding wood properties and drying conditions. Finally, a classification approach will be delivered to categorize dried wood into three groups: Acceptable (normal), over-dried, and under-dried. Finally, the number of predictors for node splitting was equal to the square roo total number of predictors.

Results and Discussion
The results will analyze and characterize the selected initial and final wood and their correlation with drying parameters, drying schedule aggressiveness, condition, and post-drying storage. Then, a predictive approach will be provided mate the Mf of each timber piece based on its corresponding wood properties and conditions. Finally, a classification approach will be delivered to categorize drie into three groups: acceptable (normal), over-dried, and under-dried. Figures 2 and 3 are interval plots representing the impact of conditioning an storage on the Mf variation, respectively. These results are based on the 95% of th dence interval for the Mf mean. Both figures indicate that modified drying schedu siderably increased the average Mf, and this effect is more noticeable than the cond or post-storage. The control drying schedule had eight time-based steps that too which was longer than the modified drying schedules. This long drying tim grounds to the lower Mf mean at the end of the control drying run, as it allocated su time for under-dried wood to decrease in moisture. Applying conditioning and po age reduced the variation in Mf for both modified schedules because, while cond and post-storage allow under-dried wood to lose moisture, they let over-dried w gain moisture. Additionally, while for each drying schedule the role of condition post-storage is insignificant, there was a remarkable difference between the Mf in modified drying schedules when the timber pieces underwent conditioning or po age.     Figure 4 shows that schedule I accounts for the highest Mf mean (15.59%) and variation (5.16%), while the lowest Mf mean (10.87) and variation (2.19) values belong to the 42 timber pieces that underwent the control schedule. The Mf mean is very close to the Mt, which could be attributed to the long drying time compared to the modified ones. Figure 5 demonstrates that timber pieces with conditioning had a slightly smaller standard deviation (4.31%) than those without conditioning (StDev = 5.47%). Likewise, Figure 6 exhibits that timber pieces with post-storage had an insubstantial smaller standard deviation (4.54%) than those without conditioning (StDev = 5.07%). In conditioning and post-storage, the Memc (12.3%) is very close to Mt (12%), letting the Mf reach the Mt and increasing moisture uniformity.    Figure 4 shows that schedule I accounts for the highest M f mean (15.59%) and variation (5.16%), while the lowest M f mean (10.87) and variation (2.19) values belong to the 42 timber pieces that underwent the control schedule. The M f mean is very close to the M t , which could be attributed to the long drying time compared to the modified ones. Figure 5 demonstrates that timber pieces with conditioning had a slightly smaller standard deviation (4.31%) than those without conditioning (StDev = 5.47%). Likewise, Figure 6 exhibits that timber pieces with post-storage had an insubstantial smaller standard deviation (4.54%) than those without conditioning (StDev = 5.07%). In conditioning and post-storage, the M emc (12.3%) is very close to M t (12%), letting the M f reach M t and increasing moisture uniformity.   Figure 4 shows that schedule I accounts for the highest Mf mean (15.59%) and variation (5.16%), while the lowest Mf mean (10.87) and variation (2.19) values belong to the 42 timber pieces that underwent the control schedule. The Mf mean is very close to the Mt, which could be attributed to the long drying time compared to the modified ones. Figure 5 demonstrates that timber pieces with conditioning had a slightly smaller standard deviation (4.31%) than those without conditioning (StDev = 5.47%). Likewise, Figure 6 exhibits that timber pieces with post-storage had an insubstantial smaller standard deviation (4.54%) than those without conditioning (StDev = 5.07%). In conditioning and post-storage, the Memc (12.3%) is very close to Mt (12%), letting the Mf reach the Mt and increasing moisture uniformity.   The dependency between the wi and Mi, Mf, and ρb could be studied through a archical clustering analysis, as explained by Fathi et al. [73]. The dendrogram (Figu demonstrates three clusters and shows the similarity level between the studied varia  The dependency between the wi and Mi, Mf, and ρb could be studied through a hierarchical clustering analysis, as explained by Fathi et al. [73]. The dendrogram (Figure 7) demonstrates three clusters and shows the similarity level between the studied variables. This dendrogram indicates that ρb had the smallest similarity value (45.42%) with the Mf, which accords with the findings of the previous research on 2″ × 4″ hem-fir [38]. In the present study, Mi and wi showed the most similarity, while Rahimi and Avramidis [38]  The dependency between the w i and M i , M f , and ρ b could be studied through a hierarchical clustering analysis, as explained by Fathi et al. [73]. The dendrogram (Figure 7) demonstrates three clusters and shows the similarity level between the studied variables. This dendrogram indicates that ρ b had the smallest similarity value (45.42%) with the M f , which accords with the findings of the previous research on 2" × 4" hem-fir [38]. In the present study, M i and w i showed the most similarity, while Rahimi and Avramidis [38] observed the most similarity between M f and M i in the previous research. The initial weight of the timber can be measured accurately and non-destructively. It is challenging to measure the moisture above the fiber saturation by moisture meters, and cutting cookies is a time-consuming and destructive method that cannot be performed at sawmills.

92
9 of 16 weight of the timber can be measured accurately and non-destructively. It is challenging to measure the MC above the fibre saturation by moisture meters, and cutting cookies is a time-consuming and destructive method which cannot be performed at sawmills. It was interesting to see that the drying schedule, conditioning, and post-storage protocols noticeably impacted the correlation between the Mf and the input variables. Table  5 documents the correlation between Mf and initial wood indices in nine drying runs. Accordingly, the highest correlation between Mi and Mf (0.62%) was in I_C_NS (abbreviated names defined in Table 1), while the lowest correlation between Mi and Mf (0.15%) was in UN. Furthermore, the highest correlation between ρb and Mf (0.60%) was in II_NC_NS, while the lowest correlation between ρb and Mf (0.12%) was in II_NC_S. Moreover, the highest correlation between wi and Mf (0.75%) was in I_NC_S, whereas the lowest correlation between wi and Mf (0.38%) was in II_NC_S. Overall, wi showed the highest correlation values with Mf in all drying runs, excluding II_NC_NS. Overall, ρb has the lowest correlation with Mf because ρb is naturally based on oven-dried weight and is independent of moisture level. Moreover, the volume change is negligible compared to weight change after kiln-drying, which further justifies the insubstantial correlation between ρb and Mf. Table 5. The correlation between Mf and initial wood indices in nine drying runs (abbreviated names of the drying schedules are defined in Table 1).

Drying Schedule
Correlation between Wood Indices Mi and Mf wi and Mf ρb and Mf It was interesting to see that the drying schedule, conditioning, and post-storage protocols noticeably impacted the correlation between the M f and the input variables. Table 5 documents the correlation between M f and initial wood indices in nine drying runs. Accordingly, the highest correlation between M i and M f (0.62%) was in I_C_NS (abbreviated names defined in Table 1), while the lowest correlation between M i and M f (0.15%) was in UN. Furthermore, the highest correlation between ρ b and M f (0.60%) was in II_NC_NS, while the lowest correlation between ρ b and M f (0.12%) was in II_NC_S. Moreover, the highest correlation between w i and M f (0.75%) was in I_NC_S, whereas the lowest correlation between w i and M f (0.38%) was in II_NC_S. Overall, w i showed the highest correlation values with M f in all drying runs, excluding II_NC_NS. Overall, ρ b has the lowest correlation with M f because ρ b is naturally based on oven-dried weight and is independent of moisture level. Moreover, the volume change is negligible compared to weight change after kiln-drying, which further justifies the insubstantial correlation between ρ b and M f . Table 5. The correlation between M f and initial wood indices in nine drying runs (abbreviated names of the drying schedules are defined in Table 1). However, the correlation values in this study were considerably smaller than the findings of the former study [38]. In the former study, six drying batches underwent an identical drying schedule, while conditioning and post-storage were nonexistent. In contrast, this study included three drying schedules (with different M emc at the final step) followed by conditioning and post-storage. These two post-drying treatments level out M f variation and give grounds to the lower correlation between M i and M f . Figure 8 shows the relative importance (RI) of the inputs in the predictive model, indicating that w i is the most remarkable parameter in this model (RI = 100), followed by the M i (92.6%) and ρ b (84.4%). The RI of drying schedule, post-storage, and conditioning were 63.3%, 45.0%, and 41.0%, respectively. This outcome shows that all the listed parameters considerably impact the model's performance, though they have different RI values. It is worth mentioning that these results are moderately different from the findings by Rahimi et al. [40], in which M i was the most important input. This difference may stem from different drying schedules, applying post-drying treatments, or different timber dimensions (2" × 4" vs. 4" × 4"). However, the correlation values in this study were considerably smaller than the findings of the former study [38]. In the former study, six drying batches underwent an identical drying schedule, while conditioning and post-storage were nonexistent. In contrast, this study included three drying schedules (with different Memc at the final step) followed by conditioning and post-storage. These two post-drying treatments level out Mf variation and give grounds to the lower correlation between Mi and Mf. Figure 8 shows the relative importance (RI) of the inputs in the predictive model, indicating that wi is the most remarkable parameter in this model (RI = 100), followed by the Mi (92.6%) and ρb (84.4%). The RI of drying schedule, post-storage, and conditioning were 63.3%, 45.0%, and 41.0%, respectively. This outcome shows that all the listed parameters considerably impact the model's performance, though they have different RI values. It is worth mentioning that these results are moderately different from the findings by Rahimi et al. [40], in which Mi was the most important input. This difference may stem from different drying schedules, applying post-drying treatments, or different timber dimensions (2″ × 4″ vs. 4″ × 4″).  Table 6 lists the selected statistical parameters for the training and test datasets in the Mf predictive model. These results were based on the six predictors, including three wood attributes (Mi, wi, and ρb) and three drying parameters (schedule, conditioning, and poststorage). The optimal performance (Figure 9) was achieved by having 550 trees in the model. The predictive model had an R 2 of 73.86% and 44.81% for the training and test, respectively. Table 6. Model summary for predicting the Mf using TreeNet including six inputs.  Table 6 lists the selected statistical parameters for the training and test datasets in the M f predictive model. These results were based on the six predictors, including three wood attributes (M i , w i , and ρ b ) and three drying parameters (schedule, conditioning, and post-storage). The optimal performance (Figure 9) was achieved by having 550 trees in the model. The predictive model had an R 2 of 73.86% and 44.81% for the training and test, respectively.   Figure 9 shows that the R 2 depends on the number of trees in the TreeNet model. This model had an unsatisfactory performance, with a low number of trees (N < 250). Comparing the training test results in Figure 9 discloses overfitting issues with the model. The actual (experimental) Mf versus the fitted (predicted) Mf is also shown in Figure 10.    Figure 9 shows that the R 2 depends on the number of trees in the TreeNet model. This model had an unsatisfactory performance, with a low number of trees (N < 250). Comparing the training test results in Figure 9 discloses overfitting issues with the model. The actual (experimental) Mf versus the fitted (predicted) Mf is also shown in Figure 10. An additional study was performed to assess the role of the categorical parameters, including the drying schedule, conditioning, and post-storage, on the performance of the predictive model. Thus, another regression model was trained, using only three parameters (Mi, wi, and ρb). Table 7 shows the model summary for this analysis. This model included 2000 grown trees with 214 optimal numbers of trees. The predictive model had an An additional study was performed to assess the role of the categorical parameters, including the drying schedule, conditioning, and post-storage, on the performance of the predictive model. Thus, another regression model was trained, using only three parameters (M i , w i , and ρ b ). Table 7 shows the model summary for this analysis. This model included 2000 grown trees with 214 optimal numbers of trees. The predictive model had an R 2 of 56.80% and 32.10% for the training and test, respectively. A comparison between the results of the two models (Tables 6 and 7) reveals that including the drying parameters improved the accuracy of the predictive model. Overall, the developed model failed to predict the M f accurately. This failure is justified by the small sample size per drying run (42 boards) compared to the previous research (384 boards) [38]. Furthermore, applying post-drying treatments leveled off the moisture variation and slightly diluted the role of M i in predicting M f .

Moisture Classification
Since the regression approach failed to predict the M f with acceptable accuracy, it was attempted to classify the M f as having the input parameters and predict the chance of having over-or under-dried timber. This would be a crucial quality control task for drying processes. Accordingly, the classification was performed using TreeNet with the same assumption defined for the regression approach. Figure 11 illustrates the RI of the inputs in the predictive model for moisture classification. In this model, w i is the most important parameter (RI = 100), followed by M i (90.0%) and ρ b (71.8%). The RI values of schedule, post-storage, and conditioning were, in turn, 53.7%, 43.7%, and 32.7%, respectively. It is observed that the inputs have the same order in terms of relative importance for the moisture prediction ( Figure 8) and moisture classification (Figure 11) models.
Since the regression approach failed to predict the Mf with acceptable accuracy, it was attempted to classify the Mf as having the input parameters and predict the chance of having over-or under-dried timber. This would be a crucial quality control task for drying processes. Accordingly, the classification was performed using TreeNet with the same assumption defined for the regression approach. Figure 11 illustrates the RI of the inputs in the predictive model for moisture classification. In this model, wi is the most important parameter (RI = 100), followed by Mi (90.0%) and ρb (71.8%). The RI values of schedule, post-storage, and conditioning were, in turn, 53.7%, 43.7%, and 32.7%, respectively. It is observed that the inputs have the same order in terms of relative importance for the moisture prediction ( Figure 8) and moisture classification (Figure 11) models. Figure 11. The relative importance of the inputs used to train the random forest approach for the Mf classifier model. Table 8 lists the confusion matrix and the classification summary. The highest accuracy for the training and test data belonged to the over-dried (89.66%) and acceptable class (71.64%). Additionally, the lowest accuracy for the training and test data belonged to the acceptable (71.64%) and over-dried (58.62%) class. Overall, the model could classify the wood with an accuracy of 76.19% during the training and 69.05% for the test data. Considering the small sample size, this is a promising performance that could be further enhanced by expanding the dataset. Figure 11. The relative importance of the inputs used to train the random forest approach for the M f classifier model. Table 8 lists the confusion matrix and the classification summary. The highest accuracy for the training and test data belonged to the over-dried (89.66%) and acceptable class (71.64%). Additionally, the lowest accuracy for the training and test data belonged to the acceptable (71.64%) and over-dried (58.62%) classes. Overall, the model could classify the wood with an accuracy of 76.19% during the training and 69.05% for the test data. Considering the small sample size, this is a promising performance that could be further enhanced by expanding the dataset.  Table 9 documents the summary of the misclassification and error. This result indicates that, collectively, the error increased from the training data (23.81%) to the test data (30.95%) for all classes. Classifying over-dried timber had the best training result, with a 10.34% error, while acceptable class had the best test result with a 28.36% error. Overall, classification could categorize timber pieces into three classes based on their M f with acceptable accuracy. This could be beneficial to wood manufacturing companies, as sawmills can apply this model to improve pre-and post-sorting strategies. The optimum breakpoints for the dry-sort-re-dry method could be accurately determined using the outcome of this classification approach. It is noteworthy that this research included some limitations, including relatively small sample size (42 boards per run) and single setpoint (M t = 12%). Therefore, future research should focus on a bigger sample size to improve the training and test performance of the model. Moreover, future studies should broaden the range of M f moisture prediction by selecting multiple M t for different drying runs. This study utilized the TreeNet gradient boosting model. Despite the proven effectiveness of tree-based ensemble models, future research can perform comparative studies to better reveal the performance of the selected model against other techniques, such as ANNs or support vector machines. While this research focused on M f between timber pieces, future studies may have to characterize and model M f within every single piece of timber (core and shells) [74] and casehardening [75]. Moreover, future studies may have to provide predictive and classifying models for drying defects, such as surface checks [76], internal checks (honeycombing) [77], and shape distortions [78]. Finally, future research should investigate the effectiveness of different NDE methods for the fast and reliable assessment of timber MC. Acoustic and ultrasound signals were shown to be sensitive to wood characteristics such as MC [79]. Additionally, the suitability of near-infrared (NIR) spectroscopy, as a widely used NDE method for wood characterization and monitoring [80][81][82][83], could be assessed for MC monitoring in kiln-dried timber at sawmills.

Conclusions
This research provided a holistic approach that considers selected wood indices and drying parameters in modeling moisture after kiln drying. Including the drying parameters in the model significantly improved the accuracy of the TreeNet, despite showing lower relative importance compared to the wood attributes. This finding emphasizes that a robust and accurate model should include not only wood attributes but also drying parameters. From a practical standpoint, w i had the highest correlation with M f among the input variables. This result was outstanding from a practical viewpoint, as weighing timber in sawmills is a fast and non-destructive test. The outcome of this research is an advanced step in optimizing drying schedules concerning final moisture variation. Classifying models are highly applicable to optimizing post-sorting strategies such as dry-sort-re-dry.